<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.net.SocketListener</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.net.SocketListener");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/SocketListener.d?rev=3327">tango.net.SocketListener</a></h1>
                
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Version:</b><br>
Initial release: June 2004<br><br>
<b>author:</b><br>Kris<br><br>
<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/SocketListener.d?rev=3327#L34">SocketListener</a></span>
<script>explorer.outline.addDecl('SocketListener');</script> : IListener;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Abstract class to asynchronously listen for incoming data on a 
        socket. This can be used with DatagramSocket &amp; MulticastSocket, 
        and might possibly be useful with a basic SocketConduit also.
        Note that DatagramSocket must first be bound to a local network
        address via bind&#40;&#41;, and MulticastSocket should first be made a 
        member of a multicast group via its join&#40;&#41; method. Note also
        that the underlying thread is not started by the constructor;
        you should do that manually via the start&#40;&#41; method.</font><br><br>
<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/SocketListener.d?rev=3327#L51">this</a></span>
<script>explorer.outline.addDecl('this');</script>(IBuffer <span class="funcparam">buffer</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Construct a listener with the requisite arguments. The
                specified buffer is populated via the provided instance
                of ISocketReader before being passed to the notify&#40;&#41;
                method. All arguments are required.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/SocketListener.d?rev=3327#L66">this</a></span>
<script>explorer.outline.addDecl('this');</script>(InputStream <span class="funcparam">stream</span>, IBuffer <span class="funcparam">buffer</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Construct a listener with the requisite arguments. The
                specified buffer is populated via the provided instance
                of ISocketReader before being passed to the notify&#40;&#41;
                method. All arguments are required.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/SocketListener.d?rev=3327#L83">notify</a></span>
<script>explorer.outline.addDecl('notify');</script>(IBuffer <span class="funcparam">buffer</span>); [abstract]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Notification callback invoked whenever the listener has
                anything to report. The buffer will have whatever content
                was available from the read&#40;&#41; operation</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/SocketListener.d?rev=3327#L91">exception</a></span>
<script>explorer.outline.addDecl('exception');</script>(char[] <span class="funcparam">msg</span>); [abstract]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Handle error conditions from the listener thread.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/SocketListener.d?rev=3327#L99">execute</a></span>
<script>explorer.outline.addDecl('execute');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Start this listener</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/SocketListener.d?rev=3327#L111">cancel</a></span>
<script>explorer.outline.addDecl('cancel');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Cancel this listener. The thread will quit only after the 
                current read&#40;&#41; request responds, or is interrrupted.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/SocketListener.d?rev=3327#L126">setErrorLimit</a></span>
<script>explorer.outline.addDecl('setErrorLimit');</script>(ushort <span class="funcparam">limit</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Set the maximum contiguous number of exceptions this 
                listener will survive. Setting a limit of zero will 
                not survive any errors at all, whereas a limit of two
                will survive as long as two consecutive errors don't 
                arrive back to back.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/SocketListener.d?rev=3327#L144">run</a></span>
<script>explorer.outline.addDecl('run');</script>(); [private]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Execution of this thread is typically stalled on the
                read&#40;&#41; method belonging to the conduit specified
                during construction. You can invoke cancel&#40;&#41; to indicate
                execution should not proceed further, but that will not
                actually interrupt a blocked read&#40;&#41; operation.</font><br><br>
<font color="black">Note that exceptions are all directed towards the handler
                implemented by the class instance. <br><br></font><br><br></dd></dl>
<script>explorer.outline.decSymbolLevel();</script></dd></dl>
<script>explorer.outline.decSymbolLevel();</script></td></tr>
                <tr><td id="docfooter">
                        Copyright (c) 2004 Kris Bell. All rights reserved :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Tue Mar  4 22:45:33 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>